# -*- coding: utf-8 -*-
import os
from liberHook.BaseHook import BaseHook
from liberLibs.dccLibs import Nuke


class Hook(BaseHook):
    def __init__(self, library, directory, ext, start, end):
        super(Hook, self).__init__(library, directory, ext, start, end)

    def execute(self):
        file_path = self.file
        if not os.path.isfile(file_path):
            self.append_error("%s is not an exist file." % file_path)
            return
        Nuke.nuke_import(file_path)
